import { Avatar, Tag } from 'antd';
import styles from './index.modules.less';
const headImg = require('../../assets/image/头像.png');

function PrisonerCard({ tag = [], name, status, setriskOpen, onClick, style, children }) {
  return (
    <div
      style={style}
      className={styles.container}
      onClick={() => {
        if (onClick) {
          onClick();
          return;
        }
        setriskOpen(true);
      }}
    >
      {children}
      <Avatar
        shape="square"
        size={90}
        icon={
          <svg
            t="1712402122116"
            className="icon"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="6209"
            width="200"
            height="200"
          >
            <path
              d="M512 64a256 256 0 1 1 0 512 256 256 0 0 1 0-512z m0 76.8a179.2 179.2 0 1 0 0 358.4 179.2 179.2 0 0 0 0-358.4zM640 601.6a294.4 294.4 0 0 1 294.08 280.96l0.32 13.44v51.2a12.8 12.8 0 0 1-12.8 12.8h-51.2a12.8 12.8 0 0 1-12.8-12.8V896a217.6 217.6 0 0 0-205.632-217.28L640 678.4H384a217.6 217.6 0 0 0-217.28 205.632L166.4 896v51.2a12.8 12.8 0 0 1-12.8 12.8h-51.2a12.8 12.8 0 0 1-12.8-12.8V896a294.4 294.4 0 0 1 280.96-294.08L384 601.6h256z"
              fill="#ffffff"
              p-id="6210"
            ></path>
            <path
              d="M858.112 729.6v76.8H170.88v-76.8zM877.44 857.6v76.8H153.728v-76.8z"
              fill="#ffffff"
              p-id="6211"
            ></path>
          </svg>
        }
      />
      <div className={styles.labelcontainer}>
        <div className={styles.name}>{name}</div>
        {status === '在押' && <div className={styles.status}>{status}</div>}
        {status !== '在押' && (
          <div className="b ">
            <Tag color="red"> {status}</Tag>
          </div>
        )}
      </div>

      <div className={styles.tagContainer}>
        {tag.map((item: any) => {
          // eslint-disable-next-line react/jsx-key
          return <Tag color={item.color}>{item.name}</Tag>;
        })}
      </div>
    </div>
  );
}

export default PrisonerCard;
